package com.jetpack.jetpacknavtest

import android.os.Bundle
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import androidx.navigation.Navigation
import kotlinx.android.synthetic.main.fragment_1.view.*

/**
 * A simple [Fragment] subclass.
 */
class Fragment3 : Fragment() {

    private lateinit var myView: View

    override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
                              savedInstanceState: Bundle?): View? {
        Log.e("fragment","3")
        myView = inflater.inflate(R.layout.fragment_3, container, false)

        myView.back.setOnClickListener {
            Navigation.findNavController(myView).popBackStack(R.id.fragment1,false)
        }

        return myView
    }

}
